/*
 * @Author: LBH 1336709799@qq.com
 * @Date: 2023-05-20 11:03:20
 * @LastEditors: LBH 1336709799@qq.com
 * @LastEditTime: 2024-11-25 09:08:22
 * @FilePath: \heima-hr\src\api\user.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import instance from '@/utils/request'

export function login(data) {
  return instance({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getProfile() {
  return instance({
    url: '/sys/profile'
  })
}

export function getInfo(token) {
  return instance({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return instance({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function updatePassword(data) {
  return instance({
    url: '/sys/user/updatePass',
    method: 'put',
    data
  })
}
